#ifndef PRINT_H_INCLUDED
#define PRINT_H_INCLUDED
#endif // PRINT_H_INCLUDED
#include <iostream>
#include <string>
#include <fstream>

using namespace std;

class Print{
    public:
        void PrintLicensing();
        void PrintInputData(InpBean);
};

inline void Print::PrintInputData(InpBean ib){
    fstream outfile;
    outfile.open("log.dat",ios::out);
    if(!outfile){
      cout<<"can not open log.dat"<<endl;
      abort();
    }
    outfile<<"the parameter:"<<endl;
    outfile<<"no. of mol : "<<NMOL<<endl;
    outfile<<endl;
    outfile<<"inter diel, exter diel, ion concentration,temprature:"<<endl;
    outfile.width(14);
    outfile.precision(8);
    outfile<<ib.di<<ib.de<<ib.ion_concentration<<ib.temprature<<endl;
    outfile<<endl;
    outfile<<" the tolerance, stop type, and method for iteration"<<endl;
    outfile<<"the mesh type is: "<<ib.meshfmt<<endl;
    outfile<<endl;
    outfile<<"nbox, nterms,nlambs for FMM";
    
}

inline void Print::PrintLicensing( ){
      cout<<"AFMPB --- "<<endl;
      cout<<"Adaptive Fast Multipole Poisson-Boltzmann Solver"<<endl;
      cout<<"Contact information "<<endl;
      cout<<"       Benzhuo Lu (bzlu@lsec.cc.ac.cn)"<<endl;
      cout<<"       Institute of Computational Mathematics"<<endl;
      cout<<"       Chinese Academy of Sciences"<<endl;
      cout<<"       Beijing 100190, China"<<endl;
      cout<<"Authors:"<<endl;
      cout<<"      Benzhuo Lu (bzlu@lsec.cc.ac.cn)"<<endl;
      cout<<"      Xiaoling Cheng (xcheng@mccammon.ucsd.edu)"<<endl;
      cout<<"      Jingfang Huang (huang@amath.unc.edu)"<<endl;
      cout<<"      James Andrew McCammon (jmccammon@ucsd.edu)"<<endl;
      cout<<"Portions Copyright (c) 2009, Institute of 1 Computational Mathematics, CAS."<<endl;
      cout<<"Portions Copyright (c) 2009, The Regents of 1 the University of California."<<endl;
      cout<<"Portions Copyright (c) 2009, Oak Ridge National 1 Laboratory"<<endl;
      cout<<"Portions Copyright (c) 2009, The University of North 1 Carolina at Chapel Hill."<<endl;
      cout<<" "<<endl;
      cout<<"All Rights Reserved."<<endl;
      cout<<" "<<endl;
      cout<<"This program is free software; you can redistribute 1 it and/or"<<endl;
      cout<<"modify it under the terms of the GNU General Public"<<endl;
      cout<<"License as published by the Free Software Foundation; 1 either"<<endl;
      cout<<"version 2 of the License, or (at your option) any 1 later version."<<endl;
      cout<<" "<<endl;
      cout<<"This program is distributed in the hope that it 1 will be useful,"<<endl;
      cout<<"but WITHOUT ANY WARRANTY; without even the implied 1 warranty of"<<endl;
      cout<<"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."<<endl;
      cout<<"See the GNU General Public License for more details."<<endl;
      cout<<" "<<endl;
      cout<<"You should have received a copy of the GNU General"<<endl;
      cout<<"Public License along with this program; if not,"<<endl;
      cout<<"write to the Free Software Foundation, Inc.,"<<endl;
      cout<<"675 Mass Ave, Cambridge, MA 02139, USA."<<endl;
      cout<<"---------------------------------------------------"<<endl;
      cout<<"AFMPB uses adaptive fast multipole method and"<<endl;
      cout<<"node-patch boundary element method to solve the"<<endl;
      cout<<"linearized Poisson-Boltzmann equation numerically, and"<<endl;
      cout<<"can output the electrostatic potentials, energies,"<<endl;
      cout<<"and forces."<<endl;
      cout<<"---------------------------------------------------"<<endl;
      cout<<"Please cite your use of AFMPB as:"<<endl;
      cout<<"Lu BZ, Cheng XL, Huang JF, and McCammon JA."<<endl;
      cout<<"Order N algorithm for computation of electrostatic"<<endl;
      cout<<"interactions in biomolecular systems. Proc. Natl."<<endl;
      cout<<"Acad. Sci. USA, 103(51):19314-19319, 2006."<<endl;
      cout<<"---------------------------------------------------"<<endl;
}


